<?php

/**
 * Account filter form base class.
 *
 * @package    dashboard
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseAccountFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'account_name'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'account_type'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'contract_date'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'contract_term'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'sales_rep'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ref_contact'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'em_contact'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'em_phone'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'service_address'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'service_state'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'service_city'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'service_zip'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_address'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_state'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_city'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_zip'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_phone'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_email'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_email2'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_email3'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_email4'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_contact'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'company_name'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_type'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_contract_date'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_contract_term'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_address'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_phone'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_state'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_city'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_zip'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_contact'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'contract_exp'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_email'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'existing_pricing'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'new_pricing'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ewaste_included'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'bchmk_pricing'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'mon_savings'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'yearly_savings'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'full_revenue'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'profit_revenue'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'account_contract_exp'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'building_date'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'current_leed_rating'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'account_removed'       => new sfWidgetFormChoice(array('choices' => array('' => '', 'no' => 'no', 'yes' => 'yes'))),
      'hauler_account_number' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hauler_payment_url'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'billing_payment_term'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'rubicon_fee_percent'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'parent_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Account'), 'add_empty' => true)),
      'auto_billing_period'   => new sfWidgetFormChoice(array('choices' => array('' => '', 'manual' => 'manual', 'month' => 'month', 'week' => 'week', 'biweek' => 'biweek', 'quarterly' => 'quarterly'))),
      'auto_billing_day'      => new sfWidgetFormChoice(array('choices' => array('' => '', 'na' => 'na', 'first' => 'first', 'last' => 'last', 'sunday' => 'sunday', 'monday' => 'monday', 'tuesday' => 'tuesday', 'wednesday' => 'wednesday', 'thursday' => 'thursday', 'friday' => 'friday', 'saturday' => 'saturday'))),
      'style'                 => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'square_feet'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'store_number'          => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'management_office'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'ownership_entity'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'franchise_name'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'num_occupants'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'restaurant_type'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'num_pumps'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'restaurant'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'num_beds'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'hospital_type'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'brokerage_office'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'property_manager'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'property_type'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'account_dateadded'     => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'disable_billing'       => new sfWidgetFormChoice(array('choices' => array('' => '', 'yes' => 'yes', 'no' => 'no'))),
      'account_comments'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'invoice_format'        => new sfWidgetFormChoice(array('choices' => array('' => '', 'split' => 'split', 'flat' => 'flat'))),
      'account_logo_url'      => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'account_name'          => new sfValidatorPass(array('required' => false)),
      'account_type'          => new sfValidatorPass(array('required' => false)),
      'contract_date'         => new sfValidatorPass(array('required' => false)),
      'contract_term'         => new sfValidatorPass(array('required' => false)),
      'sales_rep'             => new sfValidatorPass(array('required' => false)),
      'ref_contact'           => new sfValidatorPass(array('required' => false)),
      'em_contact'            => new sfValidatorPass(array('required' => false)),
      'em_phone'              => new sfValidatorPass(array('required' => false)),
      'service_address'       => new sfValidatorPass(array('required' => false)),
      'service_state'         => new sfValidatorPass(array('required' => false)),
      'service_city'          => new sfValidatorPass(array('required' => false)),
      'service_zip'           => new sfValidatorPass(array('required' => false)),
      'billing_address'       => new sfValidatorPass(array('required' => false)),
      'billing_state'         => new sfValidatorPass(array('required' => false)),
      'billing_city'          => new sfValidatorPass(array('required' => false)),
      'billing_zip'           => new sfValidatorPass(array('required' => false)),
      'billing_phone'         => new sfValidatorPass(array('required' => false)),
      'billing_email'         => new sfValidatorPass(array('required' => false)),
      'billing_email2'        => new sfValidatorPass(array('required' => false)),
      'billing_email3'        => new sfValidatorPass(array('required' => false)),
      'billing_email4'        => new sfValidatorPass(array('required' => false)),
      'billing_contact'       => new sfValidatorPass(array('required' => false)),
      'company_name'          => new sfValidatorPass(array('required' => false)),
      'hauler_type'           => new sfValidatorPass(array('required' => false)),
      'hauler_contract_date'  => new sfValidatorPass(array('required' => false)),
      'hauler_contract_term'  => new sfValidatorPass(array('required' => false)),
      'hauler_address'        => new sfValidatorPass(array('required' => false)),
      'hauler_phone'          => new sfValidatorPass(array('required' => false)),
      'hauler_state'          => new sfValidatorPass(array('required' => false)),
      'hauler_city'           => new sfValidatorPass(array('required' => false)),
      'hauler_zip'            => new sfValidatorPass(array('required' => false)),
      'hauler_contact'        => new sfValidatorPass(array('required' => false)),
      'contract_exp'          => new sfValidatorPass(array('required' => false)),
      'hauler_email'          => new sfValidatorPass(array('required' => false)),
      'existing_pricing'      => new sfValidatorPass(array('required' => false)),
      'new_pricing'           => new sfValidatorPass(array('required' => false)),
      'ewaste_included'       => new sfValidatorPass(array('required' => false)),
      'bchmk_pricing'         => new sfValidatorPass(array('required' => false)),
      'mon_savings'           => new sfValidatorPass(array('required' => false)),
      'yearly_savings'        => new sfValidatorPass(array('required' => false)),
      'full_revenue'          => new sfValidatorPass(array('required' => false)),
      'profit_revenue'        => new sfValidatorPass(array('required' => false)),
      'account_contract_exp'  => new sfValidatorPass(array('required' => false)),
      'building_date'         => new sfValidatorPass(array('required' => false)),
      'current_leed_rating'   => new sfValidatorPass(array('required' => false)),
      'account_removed'       => new sfValidatorChoice(array('required' => false, 'choices' => array('no' => 'no', 'yes' => 'yes'))),
      'hauler_account_number' => new sfValidatorPass(array('required' => false)),
      'hauler_payment_url'    => new sfValidatorPass(array('required' => false)),
      'billing_payment_term'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'rubicon_fee_percent'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'parent_id'             => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Account'), 'column' => 'account_id')),
      'auto_billing_period'   => new sfValidatorChoice(array('required' => false, 'choices' => array('manual' => 'manual', 'month' => 'month', 'week' => 'week', 'biweek' => 'biweek', 'quarterly' => 'quarterly'))),
      'auto_billing_day'      => new sfValidatorChoice(array('required' => false, 'choices' => array('na' => 'na', 'first' => 'first', 'last' => 'last', 'sunday' => 'sunday', 'monday' => 'monday', 'tuesday' => 'tuesday', 'wednesday' => 'wednesday', 'thursday' => 'thursday', 'friday' => 'friday', 'saturday' => 'saturday'))),
      'style'                 => new sfValidatorPass(array('required' => false)),
      'square_feet'           => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'store_number'          => new sfValidatorPass(array('required' => false)),
      'management_office'     => new sfValidatorPass(array('required' => false)),
      'ownership_entity'      => new sfValidatorPass(array('required' => false)),
      'franchise_name'        => new sfValidatorPass(array('required' => false)),
      'num_occupants'         => new sfValidatorPass(array('required' => false)),
      'restaurant_type'       => new sfValidatorPass(array('required' => false)),
      'num_pumps'             => new sfValidatorPass(array('required' => false)),
      'restaurant'            => new sfValidatorPass(array('required' => false)),
      'num_beds'              => new sfValidatorPass(array('required' => false)),
      'hospital_type'         => new sfValidatorPass(array('required' => false)),
      'brokerage_office'      => new sfValidatorPass(array('required' => false)),
      'property_manager'      => new sfValidatorPass(array('required' => false)),
      'property_type'         => new sfValidatorPass(array('required' => false)),
      'account_dateadded'     => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'disable_billing'       => new sfValidatorChoice(array('required' => false, 'choices' => array('yes' => 'yes', 'no' => 'no'))),
      'account_comments'      => new sfValidatorPass(array('required' => false)),
      'invoice_format'        => new sfValidatorChoice(array('required' => false, 'choices' => array('split' => 'split', 'flat' => 'flat'))),
      'account_logo_url'      => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('account_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Account';
  }

  public function getFields()
  {
    return array(
      'account_id'            => 'Number',
      'account_name'          => 'Text',
      'account_type'          => 'Text',
      'contract_date'         => 'Text',
      'contract_term'         => 'Text',
      'sales_rep'             => 'Text',
      'ref_contact'           => 'Text',
      'em_contact'            => 'Text',
      'em_phone'              => 'Text',
      'service_address'       => 'Text',
      'service_state'         => 'Text',
      'service_city'          => 'Text',
      'service_zip'           => 'Text',
      'billing_address'       => 'Text',
      'billing_state'         => 'Text',
      'billing_city'          => 'Text',
      'billing_zip'           => 'Text',
      'billing_phone'         => 'Text',
      'billing_email'         => 'Text',
      'billing_email2'        => 'Text',
      'billing_email3'        => 'Text',
      'billing_email4'        => 'Text',
      'billing_contact'       => 'Text',
      'company_name'          => 'Text',
      'hauler_type'           => 'Text',
      'hauler_contract_date'  => 'Text',
      'hauler_contract_term'  => 'Text',
      'hauler_address'        => 'Text',
      'hauler_phone'          => 'Text',
      'hauler_state'          => 'Text',
      'hauler_city'           => 'Text',
      'hauler_zip'            => 'Text',
      'hauler_contact'        => 'Text',
      'contract_exp'          => 'Text',
      'hauler_email'          => 'Text',
      'existing_pricing'      => 'Text',
      'new_pricing'           => 'Text',
      'ewaste_included'       => 'Text',
      'bchmk_pricing'         => 'Text',
      'mon_savings'           => 'Text',
      'yearly_savings'        => 'Text',
      'full_revenue'          => 'Text',
      'profit_revenue'        => 'Text',
      'account_contract_exp'  => 'Text',
      'building_date'         => 'Text',
      'current_leed_rating'   => 'Text',
      'account_removed'       => 'Enum',
      'hauler_account_number' => 'Text',
      'hauler_payment_url'    => 'Text',
      'billing_payment_term'  => 'Number',
      'rubicon_fee_percent'   => 'Number',
      'parent_id'             => 'ForeignKey',
      'auto_billing_period'   => 'Enum',
      'auto_billing_day'      => 'Enum',
      'style'                 => 'Text',
      'square_feet'           => 'Number',
      'store_number'          => 'Text',
      'management_office'     => 'Text',
      'ownership_entity'      => 'Text',
      'franchise_name'        => 'Text',
      'num_occupants'         => 'Text',
      'restaurant_type'       => 'Text',
      'num_pumps'             => 'Text',
      'restaurant'            => 'Text',
      'num_beds'              => 'Text',
      'hospital_type'         => 'Text',
      'brokerage_office'      => 'Text',
      'property_manager'      => 'Text',
      'property_type'         => 'Text',
      'account_dateadded'     => 'Date',
      'disable_billing'       => 'Enum',
      'account_comments'      => 'Text',
      'invoice_format'        => 'Enum',
      'account_logo_url'      => 'Text',
    );
  }
}
